<!--客户信息-->
<div class="partner-title">
    <strong class="pull-left"><?php echo L('Custom_information'); ?></strong>
    <span class="btn pull-right choose-customer js-choose-customer hide"><?php echo L('regular_customer'); ?></span>
    <span class="btn pull-right edit-customer-info js-mode-btn hide"><?php echo L('edit'); ?></span>
    <span class="btn pull-right save-customer-info js-mode-btn hide"><?php echo L('Save'); ?></span>
</div>
<div class="create-customer edit-mode js-create-customer">
    <table class="mt1x customer-info">
        <tr>
            <td>
                <?php echo L('fristname') ?>:<span
                    class="val"><?php echo isset($address['delivery_first_name']) ? $address['delivery_first_name'] : null ?></span>
                <input type="text" name="delivery_first_name" id="delivery_first_name"
                       value="<?php echo isset($address['delivery_first_name']) ? $address['delivery_first_name'] : null ?>"
                       class="required delivery_first_name" alt="<?php echo L('inputfristname'); ?>"/>
            </td>
            <td>
                <?php echo L('gendername') ?>:<span
                        class="val"><?php echo isset($address['gendername']) ? $address['gendername'] : null ?></span>
                <select name="gendername" id="gendername_select" placeholder="<?php echo L('gendername') ?>">
                    <option value="男" selected>男</option>
                    <option value="女">女</option>
                </select>
            </td>
            <td >
                <?php echo L('phone') ?>:<span
                    class="val"><?php echo isset($address['delivery_phone']) ? $address['delivery_phone'] : null ?></span>
                <input type="text" id="delivery_phone" name="delivery_phone"
                       value="<?php echo isset($address['delivery_phone']) ? $address['delivery_phone'] : null ?>"
                       class="required delivery_phone" alt="<?php echo L('inputphone') ?>"/>
            </td>
            <td>
                <?php echo L('email') ?>:<span
                    class="val"><?php echo isset($address['delivery_email']) ? $address['delivery_email'] : null ?></span>
                <input type="text" name="delivery_email" id="delivery_email"
                       value="<?php echo isset($address['delivery_email']) ? $address['delivery_email'] : null ?>"
                       class=" delivery_email" alt="<?php echo L('inputemail') ?>" placeholder="<?php echo L('_additional_'); ?>"/>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <?php echo L('_STREET_LINE1_'); ?>:<span
                    class="val"><?php echo isset($address['delivery_address']) ? $address['delivery_address'] : null ?></span>
                <input type="text" name="delivery_address" id="delivery_address"
                       value="<?php echo isset($address['delivery_address']) ? $address['delivery_address'] : null ?>"
                       class="required delivery_address" alt="<?php echo L('inputaddress') ?>"/>
            </td>
            <td colspan="2">
                <?php echo L('_STREET_LINE2_'); ?>:<span
                    class="val"><?php echo isset($address['delivery_address2']) ? $address['delivery_address2'] : null ?></span>
                <input type="text" name="delivery_address2" class="delivery_address2"
                       value="<?php echo isset($address['delivery_address2']) ? $address['delivery_address2'] : null ?>"
                       placeholder="<?php echo L('_additional_'); ?>"/>
            </td>
        </tr>
        <tr>
            <td>
                <?php echo L('city') ?>:<span
                    class="val"><?php echo isset($address['delivery_city']) ? $address['delivery_city'] : null ?></span>
                <input type="text" name="delivery_city" id="delivery_city"
                       value="<?php echo isset($address['delivery_city']) ? $address['delivery_city'] : null ?>"
                       class="required delivery_city" alt="<?php echo L('inputcity') ?>"/>
            </td>
            <td>
                <?php echo L('state') ?>:<span
                    class="val"><?php echo isset($address['delivery_province']) ? $address['delivery_province'] : null ?></span><input
                    type="text" name="delivery_province" id="delivery_province"
                    value="<?php echo isset($address['delivery_province']) ? $address['delivery_province'] : null ?>"
                    class="required delivery_province" alt="<?php echo L('inputstate') ?>"/>
            </td>
            <td>
                <?php echo L('couny') ?>:<span class="val"><?php if (isset($address['delivery_cid'])) {
                        foreach ($countryList as $country) {
                            if ($address['delivery_cid'] == $country['id']) echo $country['name'];
                        }
                    } ?></span>
                <input type="text" value="中国" readonly/>
                <input type="hidden" name="delivery_cid" id="delivery_cid" class="required delivery_cid"
                       alt="<?php echo L('choosecountry') ?>" value="44"/>
            </td>
            <td>
                <?php echo L('postcode') ?>:<span
                    class="val"><?php echo isset($address['delivery_postcode']) ? $address['delivery_postcode'] : null ?></span>
                <input type="text" id="delivery_postcode" name="delivery_postcode"
                       value="<?php echo isset($address['delivery_postcode']) ? $address['delivery_postcode'] : null ?>"
                       class="delivery_postcode" alt="<?php echo L('inputpostcode') ?>" placeholder="<?php echo L('_additional_'); ?>"/>
            </td>
        </tr>
    </table>
    <!--身形信息-->
    <div class="partner-title">
        <strong><?php echo L('_Measurement_1') ?></strong>
    </div>
    <div class="item-title"><?php echo L('_Information_') ?></div>
    <table class="custom-basic js-custom-basic">
        <tr>
            <td width="33.33333%">
                <?php echo L('height'); ?>:<span
                    class="val"><?php echo isset($measure['height']['cm']) ? $measure['height']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[height][cm]" class="required height"
                       value="<?php echo isset($measure['height']['cm']) ? $measure['height']['cm'] : '' ?>"
                       data-required="<?php echo L('_measure_height_rule_'); ?>"
                       data-min="<?php echo L('_measure_height_rule_1'); ?>">
            </td>
            <td width="33.33333%" class="js-weight">
                <?php echo L('weight'); ?>:<span
                    class="val"><?php echo isset($measure['weight']['kg']) ? $measure['weight']['kg'] : '' ?></span>
                <em>kg</em>
                <input type="text" name="measure[weight][kg]" class="required weight"
                       value="<?php echo isset($measure['weight']['kg']) ? $measure['weight']['kg'] : '' ?>"
                       data-required="<?php echo L('_measure_weight_rule_'); ?>"
                       data-min="<?php echo L('_measure_weight_rule_1'); ?>">
            </td>
            <td width="33.33333%" class="js-age">
                <?php echo L('age'); ?>:<span
                    class="val"><?php echo isset($measure['age']) ? $measure['age'] : '' ?></span>
                <input type="text" name="measure[age]" class="required age"
                       value="<?php echo isset($measure['age']) ? $measure['age'] : '' ?>"
                       data-required="<?php echo L('_measure_age_rule_'); ?>"
                       data-min="<?php echo L('_measure_age_rule_1_'); ?>">
            </td>
        </tr>
    </table>

    <div class="item-title"><?php echo L('size'); ?></div>
    <table class="custom-size js-custom-size">
        <tr>
            <td>
                <?php echo L('neck_length'); ?>:<span
                    class="val"><?php echo isset($measure['neck']['cm']) ? $measure['neck']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[neck][cm]" class="required neck"
                       value="<?php echo isset($measure['neck']['cm']) ? $measure['neck']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('shirt_length'); ?>:<span
                    class="val"><?php echo isset($measure['shirt']['cm']) ? $measure['shirt']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[shirt][cm]" class="required shirt"
                       value="<?php echo isset($measure['shirt']['cm']) ? $measure['shirt']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('jacket_back'); ?>:<span
                    class="val"><?php echo isset($measure['jacket_back']['cm']) ? $measure['jacket_back']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[jacket_back][cm]" class="required jacket_back"
                       value="<?php echo isset($measure['jacket_back']['cm']) ? $measure['jacket_back']['cm'] : '' ?>">
            </td>
        </tr>
        <tr>
            <td>
                <?php echo L('sleeve_length'); ?>:<span
                    class="val"><?php echo isset($measure['sleeve']['cm']) ? $measure['sleeve']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[sleeve][cm]" class="required sleeve"
                       value="<?php echo isset($measure['sleeve']['cm']) ? $measure['sleeve']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('chest_size'); ?>:<span
                    class="val"><?php echo isset($measure['chest']['cm']) ? $measure['chest']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[chest][cm]" class="required chest"
                       value="<?php echo isset($measure['chest']['cm']) ? $measure['chest']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('stomack_size'); ?>:<span
                    class="val"><?php echo isset($measure['stomach']['cm']) ? $measure['stomach']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[stomach][cm]" class="required stomach"
                       value="<?php echo isset($measure['stomach']['cm']) ? $measure['stomach']['cm'] : '' ?>">
            </td>
        </tr>
        <tr>
            <td>
                <?php echo L('bicep_size'); ?>:<span
                    class="val"><?php echo isset($measure['bicep']['cm']) ? $measure['bicep']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[bicep][cm]" class="required bicep"
                       value="<?php echo isset($measure['bicep']['cm']) ? $measure['bicep']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('wrist_size'); ?>:<span
                    class="val"><?php echo isset($measure['wrist']['cm']) ? $measure['wrist']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[wrist][cm]" class="required wrist"
                       value="<?php echo isset($measure['wrist']['cm']) ? $measure['wrist']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('pants_length'); ?>:<span
                    class="val"><?php echo isset($measure['pants']['cm']) ? $measure['pants']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[pants][cm]" class="required pants"
                       value="<?php echo isset($measure['pants']['cm']) ? $measure['pants']['cm'] : '' ?>">
            </td>
        </tr>
        <tr>
            <td>
                <?php echo L('Waist'); ?>:<span
                    class="val"><?php echo isset($measure['waist']['cm']) ? $measure['waist']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[waist][cm]" class="required waist"
                       value="<?php echo isset($measure['waist']['cm']) ? $measure['waist']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('pants_hips'); ?>:<span
                    class="val"><?php echo isset($measure['pants_hips']['cm']) ? $measure['pants_hips']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[pants_hips][cm]" class="required pants_hips"
                       value="<?php echo isset($measure['pants_hips']['cm']) ? $measure['pants_hips']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('thigh_size'); ?>:<span
                    class="val"><?php echo isset($measure['thigh']['cm']) ? $measure['thigh']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[thigh][cm]" class="required thigh"
                       value="<?php echo isset($measure['thigh']['cm']) ? $measure['thigh']['cm'] : '' ?>">
            </td>
        </tr>
        <tr>
            <td>
                <?php echo L('knee_size'); ?>:<span
                    class="val"><?php echo isset($measure['knee']['cm']) ? $measure['knee']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[knee][cm]" class="required knee"
                       value="<?php echo isset($measure['knee']['cm']) ? $measure['knee']['cm'] : '' ?>">
            </td>
            <td>
                <?php echo L('crotch'); ?>:<span
                    class="val"><?php echo isset($measure['crotch']['cm']) ? $measure['crotch']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[crotch][cm]" class="required crotch"
                       value="<?php echo isset($measure['crotch']['cm']) ? $measure['crotch']['cm'] : '' ?>">
            </td>
            <td>
                小腿围:<span
                    class="val"><?php echo isset($measure['xiaotui']['cm']) ? $measure['xiaotui']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[xiaotui][cm]" class="required xiaotui"
                       value="<?php echo isset($measure['xiaotui']['cm']) ? $measure['xiaotui']['cm'] : '' ?>">
            </td>
        </tr>
        <tr>
            <td class="custormer_nv_td" style="display: none">
                BP间距:<span
                        class="val"><?php echo isset($measure['bp_jianju']['cm']) ? $measure['bp_jianju']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[bp_jianju][cm]" class="required bp_jianju"
                       value="<?php echo isset($measure['bp_jianju']['cm']) ? $measure['bp_jianju']['cm'] : '' ?>">
            </td>
            <td class="custormer_nv_td" style="display: none">
                BP居肩:<span
                        class="val"><?php echo isset($measure['bp_jujian']['cm']) ? $measure['bp_jujian']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[bp_jujian][cm]" class="required bp_jujian"
                       value="<?php echo isset($measure['bp_jujian']['cm']) ? $measure['bp_jujian']['cm'] : '' ?>">
            </td>
            <td class="custormer_nv_td" style="display: none">
                前腰节长:<span
                        class="val"><?php echo isset($measure['qianyao_chang']['cm']) ? $measure['qianyao_chang']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[qianyao_chang][cm]" class="required qianyao_chang"
                       value="<?php echo isset($measure['qianyao_chang']['cm']) ? $measure['qianyao_chang']['cm'] : '' ?>">
            </td>
        </tr>
        <tr>
            <td class="custormer_nv_td" style="display: none">
                后腰节长:<span
                        class="val"><?php echo isset($measure['houyao_chang']['cm']) ? $measure['houyao_chang']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[houyao_chang][cm]" class="required houyao_chang"
                       value="<?php echo isset($measure['houyao_chang']['cm']) ? $measure['houyao_chang']['cm'] : '' ?>">
            </td>
            <td class="custormer_nv_td" style="display: none">
                前胸宽:<span
                        class="val"><?php echo isset($measure['qianxiong_kuan']['cm']) ? $measure['qianxiong_kuan']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[qianxiong_kuan][cm]" class="required qianxiong_kuan"
                       value="<?php echo isset($measure['qianxiong_kuan']['cm']) ? $measure['qianxiong_kuan']['cm'] : '' ?>">
            </td>
            <td class="custormer_nv_td" style="display: none">
                后背宽:<span
                        class="val"><?php echo isset($measure['houbei_kuan']['cm']) ? $measure['houbei_kuan']['cm'] : '' ?></span>
                <em>cm</em>
                <input type="text" name="measure[houbei_kuan][cm]" class="required houbei_kuan"
                       value="<?php echo isset($measure['houbei_kuan']['cm']) ? $measure['houbei_kuan']['cm'] : '' ?>">
            </td>
        </tr>
    </table>
    <input type="hidden" name="unit" value="<?php echo isset($unit) ? $unit : 'cm'; ?>">


    <!--成衣信息-->
    <div class="tab" id="tab2">
        <div class="partner-title">
            <strong>成衣尺寸</strong>
        </div>
        <div class="tab-nav j-tab-nav">

            <a href="javascript:void(0);" class="current">西服上衣</a>

            <a href="javascript:void(0);">单裤</a>

            <a href="javascript:void(0);">马甲</a>

            <a href="javascript:void(0);">衬衫</a>

            <a href="javascript:void(0);">大衣</a>
            <a href="javascript:void(0);">羊绒衫</a>

            <a href="javascript:void(0);">皮鞋</a>

            <a href="javascript:void(0);">风衣</a>

        </div>
        <div class="tab-con">
            <div class="j-tab-con">
                <?php $j = 1; ?>
                <?php foreach ($size_type as $key => $val) { ?>
                    <?php if($val['type_name']!="九分裤" && $val['type_name']!="短裤" && $val['type_name']!="牛仔裤" && $val['type_name']!="短款大衣" &&  $val['type_name']!="长款大衣"){ ?>
                    <div class="tab-con-item" <?php if ($j == 1){ ?>style="display:block;"<?php } ?>>
                        <input type="hidden" name="size_measure[<?php echo $val['id']; ?>][model]" value="合身">
                        <input type="hidden" name="size_measure[<?php echo $val['id']; ?>][chima]" value="24">
                        <table class="Garment_size">
                            <tbody>
                            <?php $i = 0;
                            foreach ($val['size_name'] as $k => $v) { ?>
                                <?php if ($v['more_type'] == 1) continue; ?>
                                <?php if ($i % 3 == 0) { ?>
                                    <tr>
                                <?php } ?>
                                <td class="gender_<?php echo $v['gender']; ?>_td" <?php if ($v['gender'] == 2 && $address['gendername'] != "女") { ?> style="display: none" <?php } ?>>
                                    <?php echo $v['size_name']; ?>:<span class="val"><?php echo isset($size_measure[$val['id']][cy][$v['id']]) ? $size_measure[$val['id']][cy][$v['id']] : '' ?></span>
                                    <?php if($v['size_name']=="尺码"){ ?>
                                        <em>#</em>
                                    <?php }else{ ?>
                                        <em>cm</em>
                                    <?php } ?>
                                    <input value="<?php echo isset($size_measure[$val['id']][cy][$v['id']]) ? $size_measure[$val['id']][cy][$v['id']] : '' ?>"
                                           class="size_measure[<?php echo $val['id']; ?>][cy][<?php echo $v['id']; ?>]"
                                           name="size_measure[<?php echo $val['id']; ?>][cy][<?php echo $v['id']; ?>]"
                                           type="text" data="<?php echo $i % 3; ?>">
                                </td>
                                <?php if ($i % 3 == 2) { ?>
                                    </tr>
                                <?php } ?>
                                <?php $i++;
                            } ?>
                            </tbody>
                        </table>
                    </div>
                    <?php $j++; ?>
                        <?php } ?>
                <?php } ?>
            </div>
        </div>
    </div>


    <div class="item-title"><?php echo L('_Somatotype_'); ?></div>
    <div class="custom-shape clearfix">
        <div class="col-md-3 col-sm-3 col-xs-6 item">
            <p><?php echo L('shoulders'); ?>:<span
                    class="val"><?php if ($measure['shoulder']['type'] == 1): echo L('square_shoulders');
                    elseif ($measure['shoulder']['type'] == 3): echo L('rounder_shoulders');
                    elseif ($measure['shoulder']['type'] == 5): echo L('sloping_shoulders');endif; ?></span></p>
            <img class="radio-img" src="/statics/front/images/measure/shoulders2-1.jpg"/>
            <div class="custom-shape-radio">
                <label><input type="radio" name="measure[shoulder][type]" class="shoulder" value="1"
                              data-img="shoulders1-1.jpg"
                              <?php if ($measure['shoulder']['type'] == 1): ?>checked<?php endif; ?>/><?php echo L('square_shoulders'); ?>
                </label>
                <label><input type="radio" name="measure[shoulder][type]" class="shoulder" value="3"
                              data-img="shoulders2-1.jpg"
                              <?php if (!$measure['shoulder'] || $measure['shoulder']['type'] == 3): ?>checked<?php endif; ?>/><?php echo L('rounder_shoulders'); ?>
                </label>
                <label><input type="radio" name="measure[shoulder][type]" class="shoulder" value="5"
                              data-img="shoulders3-1.jpg"
                              <?php if ($measure['shoulder']['type'] == 5): ?>checked<?php endif; ?>/><?php echo L('sloping_shoulders'); ?>
                </label>
            </div>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-6 item">
            <p><?php echo L('chest'); ?>:<span
                    class="val"><?php if ($measure['chest_type']['type'] == 1): echo L('muscular_chest');
                    elseif ($measure['chest_type']['type'] == 3): echo L('flat_chest');
                    elseif ($measure['chest_type']['type'] == 5): echo L('large_chest');endif; ?></span></p>
            <img class="radio-img" src="/statics/front/images/measure/chest2-1.jpg">
            <div class="custom-shape-radio">
                <label><input type="radio" name="measure[chest][type]" class="chest_type" value="1"
                              data-img="chest1-1.jpg"
                              <?php if ($measure['chest_type']['type'] == 1): ?>checked<?php endif; ?>/><?php echo L('muscular_chest'); ?>
                </label>
                <label><input type="radio" name="measure[chest][type]" class="chest_type" value="3"
                              data-img="chest2-1.jpg"
                              <?php if (!$measure['chest_type'] || $measure['chest_type']['type'] == 3): ?>checked<?php endif; ?>/><?php echo L('flat_chest'); ?>
                </label>
                <label><input type="radio" name="measure[chest][type]" class="chest_type" value="5"
                              data-img="chest3-1.jpg"
                              <?php if ($measure['chest_type']['type'] == 5): ?>checked<?php endif; ?>/><?php echo L('large_chest'); ?>
                </label>
            </div>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-6 item">
            <p><?php echo L('flat_posture_1'); ?>:<span
                    class="val"><?php if ($measure['posture']['type'] == 1): echo L('flat_posture');
                    elseif ($measure['posture']['type'] == 3): echo L('straight_posture');
                    elseif ($measure['posture']['type'] == 5): echo L('relaxed_posture');endif; ?></span></p>
            <img class="radio-img" src="/statics/front/images/measure/posture1-1.jpg">

            <div class="custom-shape-radio">
                <label><input type="radio" name="measure[posture][type]" class="posture" value="1"
                              data-img="posture2-1.jpg"
                              <?php if ($measure['posture']['type'] == 1): ?>checked<?php endif; ?>/><?php echo L('flat_posture'); ?>
                </label>
                <label><input type="radio" name="measure[posture][type]" class="posture" value="3"
                              data-img="posture1-1.jpg"
                              <?php if (!$measure['posture'] || $measure['posture']['type'] == 3): ?>checked<?php endif; ?>/><?php echo L('straight_posture'); ?>
                </label>
                <label><input type="radio" name="measure[posture][type]" class="posture" value="5"
                              data-img="posture3-1.jpg"
                              <?php if ($measure['posture']['type'] == 5): ?>checked<?php endif; ?>/><?php echo L('relaxed_posture'); ?>
                </label>
            </div>
        </div>
        <div class="col-md-3 col-sm-3 col-xs-6 item">
            <p><?php echo L('flat_stomach_1'); ?>:<span
                    class="val"><?php if ($measure['stomach_type']['type'] == 1): echo L('flat_stomach ');
                    elseif ($measure['stomach_type']['type'] == 3): echo L('slightly_rounded_stomach');
                    elseif ($measure['stomach_type']['type'] == 5): echo L('rounded_stomach');endif; ?></span></p>
            <img class="radio-img" src="/statics/front/images/measure/stomach2-1.jpg">
            <div class="custom-shape-radio">
                <label><input type="radio" name="measure[stomach][type]" class="stomach_type" value="1"
                              data-img="stomach1-1.jpg"
                              <?php if ($measure['stomach_type']['type'] == 1): ?>checked<?php endif; ?>/><?php echo L('flat_stomach '); ?>
                </label>
                <label><input type="radio" name="measure[stomach][type]" class="stomach_type" value="3"
                              data-img="stomach2-1.jpg"
                              <?php if (!$measure['stomach_type'] || $measure['stomach_type']['type'] == 3): ?>checked<?php endif; ?>/><?php echo L('slightly_rounded_stomach'); ?>
                </label>
                <label><input type="radio" name="measure[stomach][type]" class="stomach_type" value="5"
                              data-img="stomach3-1.jpg"
                              <?php if ($measure['stomach_type']['type'] == 5): ?>checked<?php endif; ?>/><?php echo L('rounded_stomach'); ?>
                </label>
            </div>
        </div>
    </div>
</div>
<script>
    /*身形信息单位处理*/
    var reverseConversion = {
        convertCmToIn: function (cm) {
            var cmToIn = 2.54, //1 cm = 0.3937 inch
                inch = (Number(cm) / cmToIn).toFixed(2);
            if (inch.toString().split('.')[1] === '99') {//处理小数位都是9的情况
                inch = Number(inch.toString().split('.')[0]) + 1;
            }
            return Number(inch) === parseInt(inch) ? parseInt(inch) : inch;
        },
        convertKgToLb: function (kg) {
            var kgToLb = 0.4535, //1kg = 2.20 lbs
                lb = (Number(kg) / kgToLb).toFixed(2);
            if (lb.toString().split('.')[1] === '99') {//处理小数位都是9的情况
                lb = Number(lb.toString().split('.')[0]) + 1;
            }
            return Number(lb) === parseInt(lb) ? parseInt(lb) : lb;
        }
    };

    function convertUnit(field) {
        var $field = $(field),
            fieldName = $field.attr('name'),
            subName = fieldName.slice(0, fieldName.lastIndexOf('[')),
            unit = fieldName.slice(fieldName.lastIndexOf('[') + 1, fieldName.lastIndexOf(']')),
            conversionUnit = '',
            val = Number($field.val()),
            conversionVal = 0,
            lbToKg = 0.4535, //1lbs = 0.4535 kg
            inToCm = 2.54; //1 inch = 2.54 cm

        if (unit === 'lb') {
            conversionUnit = 'kg';
            conversionVal = val * lbToKg;
        } else if (unit === 'in') {
            conversionUnit = 'cm';
            conversionVal = val * inToCm;
        } else {
            return;
        }

        if (conversionVal !== 0 && conversionVal.toString().split('.')[1].length > 2) {
            //conversionVal = conversionVal.toFixed(2);

            if (parseInt(conversionVal) === Number(conversionVal)) {
                conversionVal = parseInt(conversionVal);
            }
        }

        if ($field.siblings('input[type=hidden][name="' + subName + '[' + conversionUnit + ']"]').length === 0) {
            $('<input type="hidden" name="' + subName + '[' + conversionUnit + ']" value="' + conversionVal + '" />').insertAfter($field);
        } else {
            $field.siblings('input[type=hidden][name="' + subName + '[' + conversionUnit + ']"]').val(conversionVal);
        }
    }
    ;

    function doUnitTransform() {
        $.each($('.js-custom-basic,.js-custom-size').find('td'), function () {
            var $this = $(this),
                $showSpan = $this.children('span'),
                $showInput = $this.children('input:text'),
                showVal = $showSpan.text();

            if (!$.trim(showVal)) {
                return true;
            }

            if ($this.hasClass('js-age')) {
                return true;
            } else if ($this.hasClass('js-weight')) {
                showVal = reverseConversion.convertKgToLb(showVal);
            } else {
                showVal = reverseConversion.convertCmToIn(showVal);
            }

            $showSpan.text(showVal);
            $showInput.val(showVal);
        });
    }

    $(function () {
        $("#gendername_select").change(function(){
                var gendernameValue = $(this).val();
                if(gendernameValue == "女"){
                    $(".custormer_nv_td").show();
                    $(".gender_2_td").show();
                }else{
                    $(".gender_2_td").find("input").val("");
                    $(".gender_2_td").hide();
                    $(".custormer_nv_td").find("input").val("");
                    $(".custormer_nv_td").hide();
                }
            }
        );
        /*体型选择*/
        $(".custom-shape-radio").on("click", "input:radio", function () {
            var $self = $(this);
            $self.closest(".item").find("img").attr("src", "/statics/front/images/measure/" + $self.data("img"));
        });
    });
</script>